package com.nandasoft.njuerp.commons.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtil {
	public static long getSecond(String startTime,String endTime){
		Date date1;
		Date date2;
		long l = 0;
		try {
			date1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(startTime);
			date2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endTime);
			l = date1.getTime() - date2.getTime() > 0 ? date1.getTime()
					- date2.getTime() : date2.getTime() - date1.getTime();
			l=l / 1000;
		} catch (ParseException e) {
			
		}
		return l;
	}
	public static long getSecond(long startTime,long endTime)
	{
		return endTime - startTime;
	}
}
